package com.example.weatherxml;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class HandlingXMLStuff extends DefaultHandler {

	private XMLDataCollected info = new XMLDataCollected();
	public String getInformation(){
		return info.dataToString();
	}
	@Override
	public void startElement(String uri, String localName, String qName,
			Attributes attributes) throws SAXException {
		// TODO Auto-generated method stub
		if (localName.equals("location")){
		String city = attributes.getValue("name");
		info.setCity(city);
	}else if (localName.equals("windSpeed")){
	String t = attributes.getValue("mps");
	int temp = Integer.parseInt(t);
	info.setTemp(temp);
		
	}

}
}
